
#ifndef _MEMBER_BHBOXLAYOUT_H_
#define _MEMBER_BHBOXLAYOUT_H_

#include <BRange>
#include <BHBoxLayout>
#include "ILayoutItem.h"

#define hboxlayout_member(layout)		((member_BHBoxLayout*)((BHBoxLayout*)layout)->_ptr)

namespace BWE
{
	class member_BHBoxLayout
	{
	public:
		member_BHBoxLayout(BHBoxLayout* layout);
		~member_BHBoxLayout();

		BRect handleRect(int index);
		void checkHandle(int& handle);
		bool dragHandle(const BPoint& pos);

		void distributeWidth();
		void applyRects();

		BHBoxLayout*		boss;
		int					spacing;
		BSize				handleSize;
		bool				splitable;

		int					totalBaseWidth;
		float				totalStretch;
		int					handleIndex;
		BRange				leftLimit;
		BRange				rightLimit;
		bool				pressed;
		BPoint				pressCenter;
		BArray<CacheSize>	dragCaches;
		BArray<ILayoutItem>	items;
	};
}

#endif
